from selenium import webdriver
from selenium.webdriver.common.by import By
from options import options
from time import sleep
class Baidu:
    def __init__(self,driver):
        self.dr = driver
    def search(self,kw):
        self.dr.find_element(By.ID,'kw').send_keys(kw)
        sleep(1)
        self.dr.find_element(By.ID,'su').click()
        sleep(3)
    def function(self):
        pass
if __name__ == '__main__':
    url = r'https://www.baidu.com/'
    dr = webdriver.Chrome(options=options)
    dr.get(url)
    dr.maximize_window()
    kw = 'python'
    baidu = Baidu(dr)
    baidu.search(kw)

